package org.jeecg.modules.demo.crm.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.crm.annotation.FileField;
import org.jeecg.modules.demo.crm.annotation.TitleField;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 项目信息
 * @Author: jeecg-boot
 * @Date:   2025-05-28
 * @Version: V1.0
 */
@Data
@TableName("c_project_application")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="c_project_application对象", description="项目信息")
public class CProjectApplication implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**项目编号*/
	@Excel(name = "项目编号", width = 15)
    @ApiModelProperty(value = "项目编号")
    private String projectNumber;
	/**项目名称*/
	@Excel(name = "项目名称", width = 15)
    @ApiModelProperty(value = "项目名称")
    @TitleField // AOP 监听文件数据，存入文件表
    private String projectName;
	/**项目描述*/
	@Excel(name = "项目描述", width = 15)
    @ApiModelProperty(value = "项目描述")
    private String projectDescription;
	/**工程详细地址*/
	@Excel(name = "工程详细地址", width = 15)
    @ApiModelProperty(value = "工程详细地址")
    private String address;
	/**项目状态*/
	@Excel(name = "项目状态", width = 15, dicCode = "project_status")
	@Dict(dicCode = "project_status")
    @ApiModelProperty(value = "项目状态")
    private String projectStatus;
	/**项目类型*/
	@Excel(name = "项目类型", width = 15,dicCode = "project_type")
    @ApiModelProperty(value = "项目类型")
    @Dict(dicCode = "project_type")
    private String projectType;
	/**发包单位*/
	@Excel(name = "发包单位", width = 15, dictTable = "c_contracting_unit", dicText = "name", dicCode = "id")
	@Dict(dictTable = "c_contracting_unit", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "发包单位")
    private String contractingUnit;
    /**管理库*/
    @Excel(name = "管理库", width = 15, dictTable = "c_library", dicText = "name", dicCode = "id")
    @Dict(dictTable = "c_library", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "管理库")
    private String libraryId;
    /**发包单位*/
    @Excel(name = "总包主体", width = 15, dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @Dict(dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @ApiModelProperty(value = "总包主体")
    private String companyInfoId;

    /**项目增项*/
    @Excel(name = "项目增项", width = 15, dictTable = "c_additional_request", dicText = "title", dicCode = "id")
    @Dict(dictTable = "c_additional_request", dicText = "title", dicCode = "id")
    @ApiModelProperty(value = "项目增项")
    private String additionalId;



	/**合同价*/
	@Excel(name = "合同价", width = 15)
    @ApiModelProperty(value = "合同价")
    private BigDecimal contractPrice;
	/**打款总金额*/
	@Excel(name = "打款总金额", width = 15)
    @ApiModelProperty(value = "打款总金额")
    private BigDecimal payment;
	/**收到总金额*/
	@Excel(name = "收到总金额", width = 15)
    @ApiModelProperty(value = "收到总金额")
    private BigDecimal receivePrice;
    /**合同价是否含税价*/
    @Excel(name = "合同价是否含税价", width = 15,replace = {"是_Y","否_N"} )
    @ApiModelProperty(value = "合同价是否含税价")
    private java.lang.String taxIncluded;
	/**税率*/
	@Excel(name = "税率", width = 15)
    @ApiModelProperty(value = "税率")
    private BigDecimal taxRate;
    /**管理费*/
    @Excel(name = "管理费", width = 15)
    @ApiModelProperty(value = "管理费")
    private BigDecimal manageFee;

	/**项目来源*/
	@Excel(name = "项目来源", width = 15, dicCode = "application_source")
	@Dict(dicCode = "application_source")
    @ApiModelProperty(value = "项目来源")
    private String source;
	/**项目合同*/
	@Excel(name = "项目合同", width = 15)
    @ApiModelProperty(value = "项目合同")
    private String projectContract;
	/**项目图纸*/
	@Excel(name = "项目图纸", width = 15)
    @ApiModelProperty(value = "项目图纸")
    @FileField // AOP 监听文件数据，存入文件表
    private String projectDrawings;
	/**计划工期（/天）*/
	@Excel(name = "计划工期（/天）", width = 15)
    @ApiModelProperty(value = "计划工期（/天）")
    private Integer duration;
	/**预计开始日期*/
	@Excel(name = "预计开始日期", width = 20, format = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "预计开始日期")
    private Date startDate;
	/**预计结束日期*/
	@Excel(name = "预计结束日期", width = 20, format = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "预计结束日期")
    private Date endDate;
	/**实际开工时间*/
	@Excel(name = "实际开工时间", width = 20, format = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "实际开工时间")
    private Date actualStartTime;
	/**实际完工实际*/
	@Excel(name = "实际完工实际", width = 20, format = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "实际完工实际")
    private Date actualCompletionTime;
	/**附件URL*/
	@Excel(name = "附件URL", width = 15)
    @ApiModelProperty(value = "附件URL")
    @FileField // AOP 监听文件数据，存入文件表
    private String attachmentUrl;
	/**关联文件记录ID*/
	@Excel(name = "关联文件记录ID", width = 15)
    @ApiModelProperty(value = "关联文件记录ID")
    @FileField // AOP 监听文件数据，存入文件表
    private String fileRecordId;
	/**合并项目（只有增项的时候有）*/
	@Excel(name = "合并项目（只有增项的时候有）", width = 15)
    @ApiModelProperty(value = "合并项目（只有增项的时候有）")
    private String mergeProjectId;

    @Excel(name = "合同关联", width = 15, dictTable = "c_contract", dicText = "contract_no", dicCode = "id")
    @Dict(dictTable = "c_contract", dicText = "contract_no", dicCode = "id")
    private String contractId;

    @Excel(name = "验收时间", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "验收时间")
    private Date acceptanceTime;

    @Excel(name = "维保结束时间", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "维保结束时间")
    private Date maintenanceTime;

    @ApiModelProperty(value = "是否收藏")
    private Integer isFavorite;

    // 新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private Integer subcontrCount;

    // 新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private BigDecimal totalProjectQuotation;

    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private BigDecimal totalGuaranteeDeposit;

    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private String warrantyPeriod;





    @Excel(name = "立项时间", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "立项时间")
    private Date establishmentTime;



}
